package com.caocaog.market.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.caocaog.market.entity.PushTaskRecord;
import com.caocaog.market.mapper.PushTaskRecordMapper;
import com.caocaog.market.service.PushTaskRecordService;
import org.jeecg.common.exception.JeecgBootException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 推送任务记录管理
 *
 * @author chechen
 * @date 2022-05-25
 */
@Service
@Transactional
public class PushTaskRecordServiceImpl extends ServiceImpl<PushTaskRecordMapper, PushTaskRecord> implements PushTaskRecordService {

    @Override
    public IPage<PushTaskRecord> queryPushTaskRecordPage(Page<PushTaskRecord> page, PushTaskRecord pushTaskRecord) {
        return super.baseMapper.queryPushTaskRecordPage(page, pushTaskRecord);
    }

    @Override
    public void addPushTaskRecord(PushTaskRecord pushTaskRecord) {
        int insertRecordCount = super.baseMapper.insertPushTaskRecord(pushTaskRecord);
        if (insertRecordCount == 0)
            throw new JeecgBootException("新增推送任务记录失败");
    }

}
